<%@ page language="java" contentType="text/html; UTF-8"
    pageEncoding="UTF-8"%>
        <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@page isELIgnored="false" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta charset="UTF-8">
	<title>添加业绩记录</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link id="bootstrap-style" href="<c:url value="/css/bootstrap.min.css"/>" rel="stylesheet">
	<link href="<c:url value="/css/bootstrap-responsive.min.css"/>" rel="stylesheet">
	<link id="base-style" href="<c:url value="/css/style.css"/>" rel="stylesheet">
	<link id="base-style-responsive" href="<c:url value="/css/style-responsive.css"/>" rel="stylesheet">
	<link href="<c:url value="/css/index.css"/>" rel="stylesheet">
	<link rel="shortcut icon" href="<c:url value="/img/favicon.ico"/>">
	<link href="<c:url value="/css/page.css"/>" rel="stylesheet">
	<%-- <link rel="stylesheet" type="text/css" href="<c:url value="/css/jquery.datetimepicker.css"/>"/> --%>
	<link href="<c:url value="/css/navuser.css"/>" rel="stylesheet">
	<link href="<c:url value="/css/but.css"/>" rel="stylesheet">
	<script src="<c:url value="/js/jquery-1.9.1.min.js"/>"></script>
	<script src="<c:url value="/js/jquery-migrate-1.0.0.min.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/js/layer/layer.js"/>"></script>
	<script src="<c:url value="/js/laydate/laydate.js"/>"></script>
	<%-- <script src="<c:url value="/js/build/jquery.datetimepicker.full.js"/>"></script> --%>
	<script src="<c:url value="/js/orgin.js"/>"></script>
	<script src="<c:url value="/js/filebut.js"/>"></script>
</head>
<script type="text/javascript">
function closebutton() {
	var index = parent.layer.getFrameIndex(window.name);  
 	parent.layer.close(index);  
 }
/*  function change(){
 	var nameVal = $("#name").val();
 	if(!nameVal){
 		alert("请输入员工名称");
 		return;
 	}
 	$.ajax({
 		type:"POST",
 		url:"/salaryc/type",
 		data:{name:nameVal},
 		success:function(data){
 			var type = data.type
 			if(type == 1){
 				$("#peice").hide();
 				$("#ton").hide();
 			}
 			if(type == 2){
 				$("#hour").hide();
 				$("#ton").hide();
 			}
 			if(type == 3){
 				$("#hour").hide();
 				$("#peice").hide();
 			}
 			//window.location.reload();
 		}
 	})
 } */
 function save(){
	 var formData = new FormData($("#customerform")[0]);
     $.ajax({  
          url: '<%=basePath%>salaryc/save',
          type: 'POST',  
          data: formData,  
          async: false,  
          cache: false,
          contentType: false,  
          processData: false,  
          success: function (result) {
                if("addok"==result){
                    alert("添加业绩成功");
                    closebutton();
                    window.parent.location.reload(); //刷新父页面
                }else if("addno"==result){
                    alert("添加业绩失败");
                }else if("updateok"==result){
                	alert("修改部门成功");
                    closebutton();
                    window.parent.location.reload(); //刷新父页面
                }else if("updateno"==result){
                	alert("修改部门失败");
                }else if("custNameExist"==result){
                	alert("部门已经存在");
                }
          }
     })
 }
</script>
<body>	
	<div id="content" class="span10" style="width: 100%;background-color:#F9F9F9;">
				
				<div style="background-color:#FFF;height: 1200px">
				
				<form name="customerform" id="customerform" method="post">
					<input type="hidden" name="id" value="${id}">
					<input type="hidden" id="type" name="type" value="">
					<div class="row-fluid content-table">
						<table class="table table-striped table-bordered bootstrap-datatable">
							<tbody>
								<tr>
									<td>姓名</td>
									<td><input style="margin-left: -152px;" type="text" id="name" name="name" value="${performance.name}"></td>
								</tr>
								<tr>
									<td>工作量</td>	
									<td>
						                <input  style="margin-left: -152px;" id="workload" name="workload" type="text" value="${performance.hour}">
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</form>
			<div class="row-fluid content-table">
					<table class="table  bootstrap-datatable" style=" border:none; border-spacing:0; border-collapse:collapse;margin:0;padding:0;">
					  <tbody>
						<tr class="content-search" style="text-align: center;">
							<td colspan="6">
								<div>
									<button style="background-color: #dadada;color: #666;" type="button" onclick="closebutton();" id="output1">取消</button>
									<button class="but" onclick="save();">保存</button>
								</div>
							</td>
						</tr>
					  </tbody>
				  </table>            
				</div>
			</div>
		</div>	
</body>
</html>